﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Content/Master.Master" Inherits="System.Web.Mvc.ViewPage<SCS.Core.ViewModels.ProductPropertiesViewModels>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.ViewModels" %>
<%@ Import Namespace="SCS.Core.Controllers" %>
<%@ Import Namespace="SCSService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Thuộc tính sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<% using (Html.BeginForm("ProductProperties", "Stock", FormMethod.Post, new { id = "sendFileForm", proid = "sendFileForm", enctype = "multipart/form-data" }))
   {%>
    <div class="clear"></div>
    <div class="column full">
    <div class="box ">
		<h2 class="box-header">	Thuộc tính sản phẩm</h2>
		<div class="box-content">

                    <div id="grid">
        		               
				                <table class="display">
                                <thead>
					                <tr>
						              
						                <th>
							                <a href="#" class="<%= StockController.GetGridThClass(ViewData, "PropertiesName") %>" 
										                onclick="<%= StockController.GetGridThOnClick(ViewData, "PropertiesName")%>">
								                Tên</a>
						                </th>
												               
						                <th>
                                            Ảnh
                                        </th>

                                        <th></th>
                                        <th></th>
					                </tr>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td colspan="2">
                                        <%if (ViewData["ProductTypePropertiesID"].ToString() != "0")
                                          { 
                                            %>
                                                <%= Html.ActionLink("Create Properties Detail", "CreateProductProperties", "Stock", new { id = ViewData["ProductTypePropertiesID"], proid = ViewData["ProductID"], typeProperid = ViewData["TypePropertiesID"] }, new { @Class = "button themed" })%>
                                            <%
                                          } %>
                                        </td>
                                    </tr>
                                </thead>
                                <% if (Model.PropertyItem.Count() == 0) { %>
			                        <tbody>
                                        <tr>
                                            <td colspan="4">
                                                Không có thuộc tính cho <%:Model.TypeProperties.TypePropertiesName.ToString() %> properties of <%: Model.Product.ProductName.ToString() %>
                                            </td>
                                        </tr>
                                    </tbody>
		                        <% } else { %>
                                <tbody>
					                <% foreach (var item in Model.PropertyItem) { %>
				    
						                <tr>
							                

							                <td>
								                <%= Html.Encode(item.PropertiesName) %>
							                </td>
							
							                <td>
                                               <img src='<%= Html.Encode(item.Images) %>' alt="" height="60px" />
                                            </td>

                                            <td>
								                <%= Html.ActionLink("Cập nhật", "PropertiesDetail", new { id = item.PropertiesID })%>							                
							                </td>
                                            <td>
                                                <%= Html.ActionLink("Xóa", "Delete", new { id=item.PropertiesID })%>
                                            </td>
						                </tr>
				    
					                <% } %>
					            </tbody>
                                <% } %>
				                </table>
			                <!-- data -->

			               <% if (Model.PropertyItem.Count() > 0)
                                { %>
			                    <% Html.RenderPartial("~/Views/Commont/Paging.ascx"); %>
		                    <% } %>
		  
	                </div>  <!-- grid -->	
                
	    </div>
	</div>
    <div class="clear"></div>
    </div>    
<% } %>   

</asp:Content>
